package net.zoneland.zrdp.system.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import net.zoneland.zrdp.common.xss.XssSanitizeSerializer;

import net.zoneland.zrdp.common.annotation.Excel;
import net.zoneland.zrdp.common.core.domain.BaseEntity;
import net.zoneland.zrdp.common.xss.Xss;

import java.util.List;

/**
 * 通知公告表 sys_notice
 *
 * @author zonevue
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class SysNotice extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 公告ID */
    @Excel(name = "ID", type = Excel.Type.EXPORT, needMerge = true)
    private Long noticeId;

    /** 公告标题 */
    @Xss(message = "公告标题不能包含脚本字符")
    @NotBlank(message = "标题不能为空")
    @JsonSerialize(using = XssSanitizeSerializer.class)
    @Size(min = 3, max = 50, message = "公告标题不能超过50个字,最少3个字")
    @Excel(name = "标题", needMerge = true)
    private String noticeTitle;

    /** 公告类型（1通知 2公告） */
    @Excel(name = "公告类型", readConverterExp = "1=通知,2=公告", needMerge = true)
    private String noticeType;

    /** 公告内容 */
    @Excel(name = "内容", needMerge = true)
    private String noticeContent;

    /** 评论 */
    @Excel(name = "评论", type = Excel.Type.EXPORT)
    private List<SysNoticeComment> sysNoticeCommentList;

    /** 公告状态（0正常 1关闭） */
    @Excel(name = "公告状态", readConverterExp = "0=正常,1=关闭", needMerge = true)
    private String status;

}
